package com.medical.manage.controller;

import com.medical.common.core.domain.Result;
import com.medical.manage.domain.vo.AppraiseVo;
import com.medical.manage.domain.vo.DoctorVo;
import com.medical.manage.domain.vo.OrderVo;
import com.medical.manage.service.AppraiseService;
import com.medical.manage.service.DoctorService;
import com.medical.manage.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * @BelongsProject: medical
 * @BelongsPackage: com.medical.manage.controller
 * @Author: szw
 * @CreateTime: 2025-03-17  20:02
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @Autowired
    private AppraiseService appraiseService;
    @Autowired
    private DoctorService doctorService;

    /**
     * 订单
     * @return
     */
    @GetMapping("/getOrder")
    public Result<List<OrderVo>> getOrder() {
        return orderService.getOrder();
    }

    /**
     * 医生信息
     * @param doctorId
     * @return
     */
    @GetMapping("/getDoctorDetail/{doctorId}")
    public Result<DoctorVo> getDoctorDetail(@PathVariable Integer doctorId) {
     return orderService.getDoctorDetail(doctorId);
    }

    /**
     * 评价医生
     * @param appraiseVo
     * @return
     */
    @PostMapping("/appraiseDoctor")
    public Result appraiseDoctor(@RequestBody AppraiseVo appraiseVo) {
        return appraiseService.appraiseDoctor(appraiseVo);
    }

    /**
     * 患者评价
     * @return
     */
    @GetMapping("/getPatientAppraise")
    public Result<List<AppraiseVo>> getPatientAppraise() {
        return appraiseService.getPatientAppraise();
    }

    /**
     * 医生回复
     * @param appraiseVo
     * @return
     */
    @PostMapping("/doctorReply")
    public Result doctorReply(@RequestBody AppraiseVo appraiseVo) {
        return appraiseService.doctorReply(appraiseVo);
    }

    /**
     * 设置问诊价格
     * @param consultationFees
     * @return
     */
    @PostMapping("/settingPrice/{consultationFees}")
    public Result settingPrice(@PathVariable BigDecimal consultationFees) {
        return doctorService.settingPrice(consultationFees);
    }

}
